
public class TicTacGame {

	public static void main(String[] args) {
		
		Board b = new Board();

		b.Initialize();
		
		Player player2 = new PlayerHuman("Vasya",Board.ZERO);
		Player player1 = new PlayerComp(Board.CROSS );
		Player playerCurent = player1;
		Player winner = null;
		
		do 
		{
			int cellNumber = playerCurent.nextStepForBoard(b);
			boolean success = b.setPieceForCell(playerCurent.piece, cellNumber);
			assert(success);
		
			if (b.checkForWin()) {
				winner = playerCurent;
				break;
			} else if (playerCurent == player2) {
				playerCurent = player1;
			} else {
				playerCurent = player2;
			}
		} while (!b.isBoardFull());

		b.print();
		if (b.checkForWin() && winner!=null) {
			System.out.println("Lose " + winner.name);
		} else {
			System.out.println("Win!");
		}
	}

}
